import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "Exams")
public class Exam {
	@Id
	@Column(name= "exam_id")	
	private Integer exam_id;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "subject_id")
	private Subject subject;
	
	@Column(name= "exam_date")
	private Date exam_date;
	
	@Column(name= "type")
	private String type;
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	private Professor prof;
	
	//getters
	
	public Integer getId(){return this.exam_id;}
	
	public Subject getSubject(){return this.subject;}
	
	public Date getExam_date(){return this.exam_date;}
	
	public String getType(){return this.type;}
	
	public Professor getProfessor(){return this.prof;}
	
	//setters
	
	public void setId(Integer id) {this.exam_id= id;}
	
	public void setSubject(Subject subject) {this.subject= subject;}
	
	public void setExam_date(Date exam_date) {this.exam_date= exam_date;}
	
	public void setType(String type) {this.type= type;}
	
	public void setProfessor(Professor prof) {this.prof= prof;}
}
